<div class="window control_users" style="">
	<div class="title">Users - <a href="/users/add">New user</a></div>
	<div class="content">
		<table>
			<tr class="header">
				<td class="username even">Username</td>
				<td class="email even">E-mail</td>
				<td class="status even">Status</td>
				<td class="role even">Role</td>
				<td class="actions even">Actions</td>
			</tr>
			<?php foreach ($users as $i => $user) : ?>
			<tr class="user">
				<td class="username <?php echo ($i % 2 == 0) ? 'not-even' : 'even'; ?>">
					<?php echo $user['User']['username']; ?>
				</td>
				<td class="email <?php echo ($i % 2 == 0) ? 'not-even' : 'even'; ?>">
					<?php echo $user['User']['email']; ?>
				</td>
				<td class="status <?php echo ($i % 2 == 0) ? 'not-even' : 'even'; ?>">
					<?php echo $user['User']['status']; ?>
				</td>
				<td class="role <?php echo ($i % 2 == 0) ? 'not-even' : 'even'; ?>">
					<?php echo $user['User']['role']; ?>
				</td>
				<td class="actions <?php echo ($i % 2 == 0) ? 'not-even' : 'even'; ?>">
					<?php if ($user['User']['status'] == 'inactive' && !empty($user['User']['registration_code'])) : ?>
						<?php echo $this->Html->link('send code', array('action' => 'send_code', $user['User']['id'])); ?>
					<?php elseif ($user['User']['status'] == 'inactive') : ?>
						<?php echo $this->Html->link('activate', array('action' => 'status', $user['User']['id'], 'active')); ?>
					<?php else : ?>
						<?php echo $this->Html->link('deactivate', array('action' => 'status', $user['User']['id'], 'inactive')); ?>
					<?php endif; ?>
				</td>
			</tr>
			<?php endforeach; ?>
		</table>
	</div>
</div>